/*
 * Copyright 2017 Baiyyy
 * @(#)CCTSServerEncoder.java
 */

package com.byyy.ccts.modules.cc.server.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * TCP粘包处理器之编码器
 * Created by DELL on 2018-5-7.
 */
public class CCTSServerEncoder extends MessageToByteEncoder<CCTSServerProtocol> {

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, CCTSServerProtocol cctsServerProtocol, ByteBuf byteBuf) throws Exception {
        byteBuf.writeBytes(cctsServerProtocol.getContent());
    }

}
